package com.hudongwx.godoffood.activity.myActivity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.hudongwx.godoffood.R;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

@ContentView(R.layout.activity_change_pwd)
public class ChangePwdActivity extends AppCompatActivity {
    @ViewInject(R.id.my_change_pwd_et_1)
    private EditText etNow;
    @ViewInject(R.id.my_change_pwd_et_2)
    private EditText etChange;
    @ViewInject(R.id.my_change_pwd_et_3)
    private EditText etChange2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        x.view().inject(this);

    }
    @Event(R.id.my_change_pwd_btn)
    private void submit(View view) {
        if ((etNow.getText() + "").equals(etChange.getText() + "")) {
            Toast.makeText(this, "原密码不能与新密码相同", Toast.LENGTH_SHORT).show();
        } else if (!(etChange2.getText() + "").equals(etChange.getText() + "")) {
            Toast.makeText(this, "原密码不能与新密码相同", Toast.LENGTH_SHORT).show();
        }else {
            Toast.makeText(this,"修改成功",Toast.LENGTH_SHORT).show();
        }
    }
    //返回拦截
    @Event(R.id.my_change_pwd_iv_back)
    private void back(View view) {
        finish();
    }
}
